<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    td {
        height: 10px;
        width: 10px;
        border: 1px red solid;
    }
</style>
<body>

</body>
</html>
<script>

    // 交换两个变量的值

    var a =20;
    var b =30;
    var temp = a;
    a = b;
    b = temp;
    console.log(a,b);

    function swap(n1,n2) {
        var temp =n1;
        n1 = n2;
        n2 = temp;
    }
    swap (a,b);
    console.log(a,b);
//    基本数据类型 number boolean string
//    引用数据类型 array object
    var arr = [20,30];
    function swap_arr(array) {
        var temp =array [0];
        array[0] = array[1];
        array[1] = temp;

    }
    swap_arr(arr);
    console.log(arr);


    document.write('<h1>eibef</h1>');
    document.write("<div>");
    document.write("我是中国" );
    document.write("</div>");
    for (var i = 1; i<= 9;i++) {
        document.write("1");
    }
    document.write('<br>');
    for (var i = 1;i < 10;i++){
        document.write('1');
    }
    document.write('<br>');

    for (var j =1; j < 10;j++){
        for (var i = 1;i < 10;i++){
            document.write(i + ' ');
        }
        document.write('<br>');
    }



    //外层循环控制行数
    //内层循环控制列数
    document.write("<table>");
    for (var j = 1; j < 10; j++){
        document.write('<tr>');
        for (var i =1;i < 10;i++);{
            document.write('<td>');
            document.write(i);
            document.write('</td>');
        }

        document.write('</tr>');
    }
    document.write("</table>");

</script>